package com.nattakute.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nattakute.dao.DepartmentDAO;
import com.nattakute.model.Department;
import com.nattakute.service.DepartmentService;

@Service("departmentService")
public class DepartmentServicesImpl implements DepartmentService{

	@Autowired
	private DepartmentDAO departmentDAO;
	
	
	@Transactional
	public List<Department> getDepartment() {
		// TODO Auto-generated method stub
		return departmentDAO.getDepartment();
	}

	
	@Transactional
	public Department getDepartmentById(Integer id) {
		// TODO Auto-generated method stub
		return departmentDAO.getDepartmentById(id);
	}

	
	@Transactional
	public Boolean addDepartment(Department department) {
		// TODO Auto-generated method stub
		return departmentDAO.addDepartment(department);
	}

	
	@Transactional
	public Boolean deleteDepartment(Department department) {
		// TODO Auto-generated method stub
		return departmentDAO.deleteDepartment(department);
	}

	
	@Transactional
	public Boolean updateDepartment(Department department) {
		// TODO Auto-generated method stub
		return departmentDAO.updateDepartment(department);
	}


	public void setDepartmentDAO(DepartmentDAO departmentDAO) {
		this.departmentDAO = departmentDAO;
	}

	
}
